// 加载font
let loader = new THREE.FontLoader();

loader.load('./fonts/MOTOR_Regular.json', function (font) {
    let geometry = new THREE.TextGeometry('this is text in threeJs!', {
        font: font,
        size: 80,
        height: 5,
        curveSegments: 12,
        bevelEnabled: true,
        bevelThickness: 10,
        bevelSize: 8,
        bevelOffset: 0,
        bevelSegments: 5
    });
});
alert("!")
// 创建场景
let scene = new THREE.Scene();

// 创建摄像头
let camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.set(-2, 2, 4)
camera.lookAt(0, 0, 0)
let renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
let geometry = new THREE.BoxGeometry(1, 1, 1);
let material = new THREE.MeshBasicMaterial({ color: 0xffffff });
let cube = new THREE.Mesh(geometry, material);
console.log(cube)
scene.add(cube);


// 渲染循环
function render() {
    // 以每秒60次的频率绘制场景
    requestAnimationFrame(render);
    renderer.render(scene, camera);
    cube.rotation.y -= 0.05;
    console.log("!");
}
render();
